import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:finance_app/src/widgets/button/add_button.dart';
import 'package:finance_app/src/widgets/form/form_edit_status_inherited_widget.dart';
import 'package:finance_app/src/widgets/wrapper/normal_form_wrapper.dart';
import 'package:flutter/material.dart';

class AccountAddForm extends StatelessWidget {
  final VoidCallback onLinked;
  final String title;
  final int count;

  const AccountAddForm({Key key, this.onLinked, this.title, this.count})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return NormalFormWrapper(
      child: FormStatusWidget(
        enable: Row(
          children: [
            Expanded(
              child: AddButton(
                title: '$title',
                onTap: onLinked,
              ),
            ),
            Text(
              '$count',
              style: TextStyle(
                color: aceBlueColor,
                fontSize: getSp(18),
                fontWeight: FontWeight.w700,
              ),
            )
          ],
        ),
        disable: Row(
          children: [
            Expanded(
              child: Text(
                title,
                style: TextStyle(
                  color: aceBlackColor,
                  fontSize: getSp(16),
                  fontWeight: FontWeight.w700,
                  height: 1,
                ),
              ),
            ),
            Text(
              '$count',
              style: TextStyle(
                color: aceBlackColor,
                fontSize: getSp(18),
                fontWeight: FontWeight.w700,
              ),
            )
          ],
        ),
      ),
    );
  }
}
